#include <gtk/gtk.h>

void 
syncup_action(GtkMenuItem *menu_item_syncup, gpointer user_data )
{
	// TODO: Fill here ba!!!
}


void 
my_menu(GtkStatusIcon *tray_icon, guint button, guint activate_time, 
															gpointer user_data)
{
   g_print("%d %d\n", (int)button, (int)activate_time );

   GtkMenu *menu;
   GtkWidget *menu_item_syncup;
   GtkWidget *menu_item_test;
   GtkWidget *menu_item_exit;

   menu = GTK_MENU(gtk_menu_new());
   menu_item_syncup = gtk_menu_item_new_with_label("syncup");
   menu_item_test = gtk_menu_item_new_with_label("test");
   menu_item_exit = gtk_menu_item_new_with_label("exit");
   gtk_menu_append(GTK_MENU(menu), menu_item_syncup );
   gtk_menu_append(GTK_MENU(menu), menu_item_test );
   gtk_menu_append(GTK_MENU(menu), menu_item_exit );
   gtk_widget_show(menu_item_syncup);
   gtk_widget_show(menu_item_test);
   gtk_widget_show(menu_item_exit);
   
   gtk_menu_popup(menu, NULL, NULL, NULL, NULL, button, activate_time );

   g_signal_connect( GTK_OBJECT(menu_item_syncup), "activate", 
   		G_CALLBACK(syncup_action), NULL );
   g_signal_connect( GTK_OBJECT(menu_item_exit), "activate", 
   		G_CALLBACK(gtk_main_quit), NULL );
}


void
show_sys_tray_icon()
{
	GtkStatusIcon *tray_icon;
	tray_icon = gtk_status_icon_new();
	gtk_status_icon_set_from_file(tray_icon, 
		"/home/israkir/Desktop/sync-up/syncup/frontend/syncup-logo.png");
	gtk_status_icon_set_tooltip(tray_icon, "sync-up");
	gtk_status_icon_set_visible(tray_icon, TRUE);
	g_signal_connect(GTK_OBJECT(tray_icon), "popup-menu", 
		G_CALLBACK(my_menu), NULL);
}
